/**
 *@author Sun Feiyue(Asfya)
*/
package com.ass.view.ui;

import com.ass.view.data.SettingsData;

public class LayoutGetter {

	private static LayoutGetter thisInstance;
	private UIMainPage[] mainPage;
	private UIAddPage[] addPage;
	private UIListPage[] listPage;
	private UIAppPage[] appPage;
	
	private LayoutGetter(){
		//TODO Refactor
		mainPage=new UIMainPage[2];
		addPage=new UIAddPage[2];
		listPage=new UIListPage[2];
		appPage=new UIAppPage[2];
		
		mainPage[0]=new TextUIMainPage();
		mainPage[1]=new ImageUIMainPage();
		addPage[0]=new TextUIAddPage();
		addPage[1]=new TextUIAddPage();
		listPage[0]=new TextUIListPage();
		listPage[1]=new ImageUIListPage();
		appPage[0]=new TextUIAppPage();
		appPage[1]=new TextUIAppPage();
	}
	
	public static LayoutGetter getInstance(){
		if(thisInstance==null){
			thisInstance=new LayoutGetter();
		}
		return thisInstance;
	}	
	
	public UIMainPage getMainPage() {
		int uiKind=SettingsData.getInstance().getGuiKind();
		return mainPage[uiKind];
	}

	public UIAddPage getAddPage() {
		int uiKind=SettingsData.getInstance().getGuiKind();
		return addPage[uiKind];
	}

	public UIListPage getListPage() {		
		int uiKind=SettingsData.getInstance().getGuiKind();
		return listPage[uiKind];
	}

	public UIAppPage getAppPage() {		
		int uiKind=SettingsData.getInstance().getGuiKind();
		return appPage[uiKind];
	}

}
